using System;
using System.Collections.Generic;
using System.Text;

using NHibernate;
using Zwms.Data.Base;
using System.Runtime.Serialization;

namespace Zwms.Data.BusinessObjects
{
    [DataContract]
    public partial class SysMenu : BusinessBase<string>
    {
        #region Declarations

        private string _roleCode = String.Empty;
        private string _moduleCode = String.Empty;
        private string _menuCode = String.Empty;
        private string _menuName = String.Empty;
        private string _parMenuCode = String.Empty;

        #endregion

        #region Constructors

        public SysMenu() { }

        #endregion

        #region Methods

        public override int GetHashCode()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append(this.GetType().FullName);
            sb.Append(_roleCode);
            sb.Append(_moduleCode);
            sb.Append(_menuCode);
            sb.Append(_menuName);
            sb.Append(_parMenuCode);

            return sb.ToString().GetHashCode();
        }

        #endregion

        #region Properties

        //public override string Id
        //{
        //    get
        //    {
        //        System.Text.StringBuilder uniqueId = new System.Text.StringBuilder();
        //        uniqueId.Append(_roleCode.ToString());
        //        uniqueId.Append("^");
        //        uniqueId.Append(_moduleCode.ToString());
        //        uniqueId.Append("^");
        //        uniqueId.Append(_menuCode.ToString());
        //        return uniqueId.ToString();
        //    }
        //}

        [DataMember]
        public virtual string RoleCode
        {
            get { return _roleCode.TrimEnd(); }
            set
            {
                _roleCode = value;
            }
        }

        [DataMember]
        public virtual string ModuleCode
        {
            get { return _moduleCode.TrimEnd(); }
            set
            {
                _moduleCode = value;
            }
        }

        [DataMember]
        public virtual string MenuCode
        {
            get { return _menuCode.TrimEnd(); }
            set
            {
                _menuCode = value;
            }
        }

        [DataMember]
        public virtual string MenuName
        {
            get { return _menuName.TrimEnd(); }
            set
            {
                _menuName = value;
            }
        }

        [DataMember]
        public virtual string ParMenuCode
        {
            get { return _parMenuCode.TrimEnd(); }
            set
            {
                _parMenuCode = value;
            }
        }

        #endregion
    }
}